import java.util.ArrayList;
import java.util.List;

public class Leet816 {
    public static void main(String[] args) {
        for (String ambiguousCoordinate : ambiguousCoordinates("(12430)")) {
            System.out.println(ambiguousCoordinate);
        }
    }
    static public List<String> ambiguousCoordinates(String S) {
        List<String> re = new ArrayList<>();
        S = S.substring(1,S.length()-1);
        System.out.println(S);
        if (S.charAt(0) != '0')
            for (int i = 1; i < S.length(); i++) {
                if (S.charAt(i) == '0') {
                    int t = i;
                    while (S.charAt(t) == '0') {
                        if (t+1==S.length())
                            break;
                        if (S.charAt(t+1) != '0')
                            re.add("(" + S.substring(0, i) + "," + S.substring(i, t+1) + "." + S.substring(t+1) + ")");
                        t++;
                    }
                }else{
                    re.add("(" + S.substring(0, i) + "," + S.substring(i) + ")");
                }

            }
        else {
            for (int i = 1; i < S.length(); i++) {
                int l = 0;
                while (S.charAt(l)=='0'){
                    if (S.charAt(i) == '0') {
                        int t = i + 1;
                        while (S.charAt(t) != '0') {
                            if (S.charAt(t) != '0')
                                re.add("(" + S.substring(0, l)+"."+S.substring(l,i) + "," + S.substring(i, t) + "." + S.substring(t) + ")");
                            t++;
                        }
                        re.add("(" + S.substring(0, i) + "," + S.substring(i) + ")");
                    }
                    l++;
                }
            }
        }
        return re;
    }
}
